package com.nyway.wehos2r.client.content.music.event;

import java.util.logging.Level;
import java.util.logging.Logger;

import com.google.gwt.event.shared.GwtEvent;
import com.nyway.wehos2r.client.content.music.SongDatabase.SongInfo;

public class PlaySongEvent extends GwtEvent<PlaySongEventHandler> {

	public static Logger logger = Logger.getLogger(PlaySongEvent.class
			.getName());

	private final SongInfo songInfo;

	public PlaySongEvent(SongInfo songInfo) {
		super();
		this.songInfo = songInfo;
		logger.log(Level.INFO, "!PlaySongEvent");
	}

	public static final Type<PlaySongEventHandler> TYPE = new Type<PlaySongEventHandler>();

	@Override
	protected void dispatch(PlaySongEventHandler handler) {
		handler.onPlay(this);
	}

	@Override
	public com.google.gwt.event.shared.GwtEvent.Type<PlaySongEventHandler> getAssociatedType() {
		return TYPE;
	}

	public SongInfo getSongInfo() {
		return songInfo;
	}

}
